package me.kuku.pojo;

import lombok.Getter;
import lombok.ToString;

@ToString
@Getter
public enum ResultStatus {
	SUCCESS(200, "成功"),
	FAIL(500, "失败"),
	PARAM_ERROR(501, "参数异常"),
	DATA_EXISTS(502, "数据已存在"),
	DATA_NOT_EXISTS(503, "数据不存在"),
	NOT_SCANNED(0, "二维码未扫描"),
	QRCODE_NOT_SCANNED(0, "二维码未扫描"),
	EXPIRED(505, "二维码已失效"),
	QRCODE_EXPIRED(505, "二维码已失效"),
	CONFIG_ERROR(506, "配置文件错误"),
	SCANNED(507, "二维码已扫描"),
	COOKIE_EXPIRED(508, "cookie已失效"),
	DYNAMIC_NOT_FOUNT(509, "动态没找到"),
	QRCODE_IS_SCANNED(0, "二维码已扫描"),
	QRCODE_IS_REFUSE(511, "二维码已被拒绝"),
	LOGIN_FAIL(512, "账号或密码错误"),
	NOT_LOGIN(513, "未登录"),
	NOT_AUTH(514, "无权限"),
	ALREADY_REGISTER(515, "已注册"),
	NOT_BIND(516, "没有绑定"),
	TYPE_ERROR(517, "类型不存在"),
	OLD_PASSWORD_ERROR(518, "原密码错误"),
	QQ_IS_BIND(519, "该qq已被绑定"),
	;


	private final Integer code;
	private final String message;

	ResultStatus(Integer code, String message){
		this.code = code;
		this.message = message;
	}

	public Result<Void> toResult(){
		return Result.failure(this);
	}
}
